<!DOCTYPE html>
<head>
<?php include_once VIEWS.'inc/head.php'; ?>
</head>

<body>
	<div id="back-top"></div>
    <?php include_once VIEWS.'inc/header.php'; ?>
		<?php include_once VIEWS.'inc/right.php'; ?>
	<div class="w1680 banner shadow2 js-wrapBox">
		<div class="js-left banner-left"></div>
		<div class="js-right banner-right"></div>
		<div class="w1190 overhide">
			<div class="img-box js-imgUl f-cb">
				<div class="link js-imgLi fl" style="background-image:url(<?php echo static_file('web/img/banner-img.jpg'); ?>);">
				<?php $bpro=$this->db->get_where('page',array('cid'=>21))->row_array();?>
					<div class=" banner-pic">
						<div class="banner-title">
							<h4 class="title-sw"><?php if(!empty($bpro['title4'])):?><?php echo $bpro['title4']?><?php endif;?><strong>&nbsp;<?php if(!empty($bpro['title5'])):?><?php echo $bpro['title5']?><?php endif;?></strong></h4>
							<img src="<?php echo static_file('web/img/banner-title.png'); ?>">
						</div>
						<ul class="banner-list">
							<li class="banner-list1 banner-list-btn">
								<span class="banner-list1-line">
									<img src="<?php echo static_file('web/img/banner-list1-line.png'); ?>">
								</span>
								
								<div class="banner-text-title"><?php if(!empty($bpro['title1'])):?><?php echo $bpro['title1']?><?php endif;?></div>
								<div class="banner-text"><?php if(!empty($bpro['content1'])):?><?php echo $bpro['content1']?><?php endif;?></div>
							
							</li>
							<li class="banner-list2 banner-list-btn">
								<span class="banner-list2-line">
									<img src="<?php echo static_file('web/img/banner-list2-line.png'); ?>">
								</span>
								
								<div class="banner-text-title"><?php if(!empty($bpro['title2'])):?><?php echo $bpro['title2']?><?php endif;?></div>
								<div class="banner-text"><?php if(!empty($bpro['content2'])):?><?php echo $bpro['content2']?><?php endif;?></div>
							
							</li>
							<li class="banner-list3 banner-list-btn">
								<span class="banner-list3-line">
									<img src="<?php echo static_file('web/img/banner-list3-line.png'); ?>">
								</span>
								<div class="banner-text-title"><?php if(!empty($bpro['title3'])):?><?php echo $bpro['title3']?><?php endif;?></div>
								<div class="banner-text"><?php if(!empty($bpro['content3'])):?><?php echo $bpro['content3']?><?php endif;?></div>
							</li>
						</ul>
					</div>
				</div>
				<!-- <div class="link js-imgLi fl" style="background-image:url(<?php echo static_file('web/img/banner-img.jpg'); ?>);"></div>
				<div class="link js-imgLi fl" style="background-image:url(<?php echo static_file('web/img/banner-img.jpg'); ?>);"></div> -->
			</div>
			<ul class="num js-point f-cb">
				<li class="cur fl"></li>
				<!-- <li class="fl"></li>
				<li class="fl"></li> -->
			</ul>
		</div>
		
	</div>

	<div class="w1680 first shadow">
		<div class="w1190 nav">
			<ul>
			<?php if(!empty($news_nav)):?>
			<?php foreach($news_nav as $k=>$v):?>
			<?php //if($k<4):?>
				<?php if($k==0):?>
				<li class="act-1 js-welc-btn " once-id="<?php echo $v['id']?>">
				<?php elseif(count($news_nav)==$k+1):?>	
				<li class="js-welc-btn" style="margin-right:0;" once-id="<?php echo $v['id']?>">
				<?php else:?>
				<li class="js-welc-btn" once-id="<?php echo $v['id']?>">
				<?php endif;?>
					<a class="show"  href="<?php echo site_url('product/index/'.$v['id']);?>"><?php echo $v['title'];?></a>
				</li>

			<?php //endif;?>
			<?php endforeach;?>
			<?php endif;?>
				<!-- <li class="all" style="margin-right:0;"><a href="<?php //echo site_url('product'); ?>">查看所有产品</a></li> -->
			</ul>
		</div>
	</div>

	<div class="w1680 second shadow js-ajax-box">
		<div class="w1190 goods">
			<div class="list-box f-cb js-ajax-box" style="width:110%;">
				<?php if(!empty($molist)):?>
				<?php foreach($molist as $k=>$v):?>
				<a href="<?php echo site_url('product/info/'.$v['id']); ?>">
					<div class="fl goods-frame">
						<img src="<?php echo UPLOAD_URL.tag_photo($v['photo']); ?>" />
						<img class="text-img-sw" src="<?php echo static_file('web/img/text-img-sw2.png'); ?>">
						<div class="goods-name"><?php echo msubstr(str_replace('&nbsp;','',trim(strip_tags($v['title']))),0,16);?></div>
						<div class="goods-state">SHOP&nbsp;NOW</div>
					</div>
				</a>
				<?php endforeach;?>
				<?php endif;?>
			</div>	
		</div>

		<hr />
		<a href="<?php echo site_url('product'); ?>"><div class="goods-more"></div></a>
	</div>

	<div class="w1680 about shadow">
		<div class="w1190">
			<div class="fl about-left">
				<div class="aboutus"></div>
				<div class="line"></div>
				<div class="about-us">关于我们</div>

				<a href="<?php echo site_url('about/intro');?>"><div class="about-more">READ&nbsp;MORE</div></a>
			</div>
			<p class="fr about-right">
				<?php echo tag_single(15); ?>
			</p>
		</div>
	</div>
	
	<div class="w1680 third shadow">
		<div class="w1190 case">
			<div class="case-top">
				<div class="casetitle"></div>
				<div class="line"></div>
				<div class="case-title">交易案例</div>
			</div>
			<div class="case-bottom">
			<?php if(!empty($nhot)):?>
			<?php foreach($nhot as $k=>$v):?>
			<?php if($k<6):?>
				<a href="<?php echo site_url('news/case_info/'.$v['id']);?>">
					<?php if(($k+1)%3==0):?>
					<div class="fl case-frame2">
					<?php else:?>
					<div class="fl case-frame">
					<?php endif;?>
						<div class="fl case-time">
							<div class="day"><?php echo date('d',$v['timeline']);?></div>
							<div class="ym"><?php echo date('Y.m',$v['timeline']);?></div>
						</div>
						<div class="fr case-text">
							<h2 class="title"><?php echo $v['title'];?></h2>
							<p class="text"><?php echo msubstr(str_replace('&nbsp;','',trim(strip_tags($v['content']))),0,30);?></p>
						</div>
					</div>
				</a>
			<?php endif;?>
			<?php endforeach;?>
			<?php endif;?>
			</div>
		</div>
	</div>

	<div class="back"></div>
	
    <?php include_once VIEWS.'inc/footer.php'; ?>
<?php
	echo static_file('web/js/main.js');
?>
</body>
</html>
<script type="text/javascript">
$(function(){
	
	// $('.first').find('.js-welc-btn').hover(function() {
	// 	var once = $(this).attr('once-id');
	// 	$(this).addClass('act-1')
	// 	.siblings().removeClass('act-1');
	// 	$.ajax({
	//         type:"GET",
	//         url: '<?php //echo site_url('welc_pro_ajax?one=');?>'+once,
	//         dataType:'html',
	//         success:function(ret){
	//         	$('.js-ajax-box').html(ret);
	//         }
	//     });
	// });
		$.ajax({
	        type:"GET",
	        url: '<?php echo site_url('welc_pro_ajax?one=');?>'+20,
	        dataType:'html',
	        success:function(ret){
	        	$('.js-ajax-box').html(ret);
	        }
	    });
		var arr =  new Array();
		var _len=$('.js-welc-btn').length;
		for(var i=0;i<_len;i++){
			arr[i]=new Array();
			for(var j=0;j<_len;j++){     
				arr[i][0]=0;
				arr[i][1]=0;
			}
		}
		var once = "<?php echo !empty($one)?$one:'';?>";
		var second = "<?php echo !empty($sec)?$sec:'';?>";
		var loadUrl='<?php echo site_url('welc_ajax?one=');?>'+once;
		$(".js-ajax-box").load(loadUrl);

		//获取a标签的地址，ajax分页
	    $('.js-ajax-box').on('click','.ajax_fpage', function(e){
	        //event.preventDefault();
	        var url = $(this).attr('href');
	        $(".js-ajax-box").load(url);
	        return false;
	    })
		
		var second = "<?php echo !empty($_GET['sec']) ? $_GET['sec'] : '' ;?>";
		var once;
		var _index2;
		$('.js-welc-btn').hover(function() {
			var once = $(this).attr('once-id');
			$(this).addClass('act-1')
			.siblings().removeClass('act-1');
			_index2 =$(this).index();
			arr[_index2][0]=$(this).attr('once-id');
			var _left=$(this).position().left;
			$.ajax({
		        type:"GET",
		        url: '<?php echo site_url('welc_pro_ajax?one=');?>'+arr[_index2][0]+'&sec='+arr[_index2][1],
		        dataType:'html',
		        success:function(ret){
		        	$('.js-ajax-box').html(ret);
		        	$('.p-first-down').show().css({
		        		left: _left
		        	});
		        }
		    })
		},function(){
			$('.p-first-down').hide();
			$('.p-first-down').hover(function(){
				$('.p-first-down').show();
			},function(){
				$('.p-first-down').hide();
			});
			
		});
		
		$(document).on('click','.js-welc-btn2',function(){
			second = $(this).attr('sec-id');
			arr[_index2][1]=$(this).attr('sec-id');
			$.ajax({
		        type:"GET",
		        url: '<?php echo site_url('welc_pro_ajax?one=');?>'+arr[_index2][0]+'&sec='+arr[_index2][1],
		        dataType:'html',
		        success:function(ret){
		        	$('.js-ajax-box').html(ret);
		        }
		    });
			var click_once=$('.js-welc-btn').attr('once-id');
		});	

		$(document).on('click','.js-pro-btn2',function(){
		second = $(this).attr('sec-id');
		arr[_index2][1]=$(this).attr('sec-id');
		$.ajax({
	        type:"GET",
	        url: '<?php echo site_url('welc_pro_ajax?one=');?>'+arr[_index2][0]+'&sec='+arr[_index2][1],
	        dataType:'html',
	        success:function(ret){
	        	$('.js-ajax-box').html(ret);
	        }
	    });
		var click_once=$('.js-welc-btn').attr('once-id');
	});	
	
})



window.onload=function(){
	autoImg('.js-wrapBox',3600,1,false,true,false);
}
</script>